﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RelationExpertSystem.Relation
{
    public class Half_Brother : RelationBase
    {
        private static Half_Brother _singleton = new Half_Brother();
        public static Half_Brother Instance
        {
            get { return _singleton; }
        }

        private Half_Brother() { }

        public override bool IsRelated(Person a, Person b)
        {
            // b is a's Half_Brother IFF b is male and b is a's half sibling
            return b.Sex == Sex.Male && a.KnownRelation(Half_Sibling.Instance, b);
        }

        public override IEnumerable<IRelation> GetDependencies()
        {
            return new HashSet<IRelation>(new IRelation[] { Half_Sibling.Instance });
        }
    }
}
